import 'reflect-metadata';
import '../polyfills';

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule,ReactiveFormsModule } from '@angular/forms';
import { HttpClientModule, HttpClient } from '@angular/common/http';
import {HttpModule} from '@angular/http';
import { CoreModule } from './core/core.module';
import { SharedModule } from './shared/shared.module';
import { AppRoutingModule } from './app-routing.module';
// NG Translate
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';

import { AppComponent } from './app.component';
import { MaterialModule } from './material/material.module';
import { ShowpdfComponent } from './showpdf/showpdf.component';
import { PdfViewerModule } from 'ng2-pdf-viewer';

import { HomeComponent } from './home/home.component';
import { ExtinfoComponent } from './extinfo/extinfo.component';
import { FindfileComponent } from './findfile/findfile.component';
import { AboutComponent } from './about/about.component';
import { SelywlxComponent } from './selywlx/selywlx.component';
import { LoginComponent } from './login/login.component';
import { AngularResizedEventModule } from 'angular-resize-event';

// AoT requires an exported function for factories
export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader {
  return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}

@NgModule({
  declarations: [AppComponent, HomeComponent,ShowpdfComponent, ExtinfoComponent, FindfileComponent, 
    AboutComponent, SelywlxComponent, LoginComponent],
  imports: [
    BrowserModule,
    FormsModule,
    ReactiveFormsModule,
    HttpModule,
    HttpClientModule,
    CoreModule,
    SharedModule,
    AppRoutingModule,
    TranslateModule.forRoot({
      loader: {
        provide: TranslateLoader,
        useFactory: HttpLoaderFactory,
        deps: [HttpClient]
      }
    }),
    MaterialModule,
    PdfViewerModule,
    AngularResizedEventModule
    
  ],
  providers: [ShowpdfComponent],
  bootstrap: [AppComponent]
})
export class AppModule {}
